package com.controller;

import com.common.R;
import com.entity.Orders;
import com.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrdersController {
    @Autowired
    private OrdersService ordersService;
    //提交订单
    @PostMapping("/submit")
    public R<String> submitOrder(@RequestBody Orders orders){
        ordersService.submit(orders);
        return R.success("提交成功！");
    }
}
